package com.ysd.lis.controller.lab;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.lab.LabBarCodeType;
import com.ysd.lis.request.AddBarCodeTypeParam;
import com.ysd.lis.request.BarCodeTypePageParam;
import com.ysd.lis.service.lab.LabBarCodeTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 分管类别 前端控制器
 * </p>
 *
 * @author Cfz
 * @since 2023-12-12
 */
@Api(tags = "分管类别")
@RestController
@RequestMapping("/api/lab/labbarcodetype")
public class LabBarCodeTypeController extends BaseController {
    @Autowired
    private LabBarCodeTypeService labBarCodeTypeService;

    @ApiOperation("获取分管类别")
    @GetMapping("/findBarCodeTypeList")
    public Result findLabBarCodeTypeList(BarCodeTypePageParam barCodeTypePageParam) {
        return labBarCodeTypeService.findLabBarCodeTypeList(barCodeTypePageParam);
    }

    @ApiOperation("添加分管类别")
    @PostMapping("/addBarCodeType")
    public Result addBarCodeType(@RequestBody LabBarCodeType labBarCodeType) {
        return labBarCodeTypeService.addBarCodeType(labBarCodeType);
    }

    @ApiOperation("编辑分管类别")
    @PostMapping("/editBarCodeType")
    public Result editBarCodeType(@RequestBody LabBarCodeType labBarCodeType) {
        return labBarCodeTypeService.editBarCodeType(labBarCodeType);
    }

    @ApiOperation("根据id分管类别")
    @PostMapping("/deleteBarCodeType")
    public Result deleteBarCodeType(@RequestBody AddBarCodeTypeParam addBarCodeTypeParam) {
        return labBarCodeTypeService.deleteBarCodeType(addBarCodeTypeParam);
    }
}
